package com.qdu.bussiness.mapper;

import java.util.Date;
import java.util.List;
import com.qdu.bussiness.domain.BusTicketPurchase;
import org.apache.ibatis.annotations.Param;

/**
 * 购票记录Mapper接口
 * 
 * @author qdu
 * @date 2022-03-06
 */
public interface BusTicketPurchaseMapper 
{
    /**
     * 查询购票记录
     * 
     * @param purchaseId 购票记录主键
     * @return 购票记录
     */
    public BusTicketPurchase selectBusTicketPurchaseByPurchaseId(Long purchaseId);

    /**
     * 查询购票记录列表
     * 
     * @param busTicketPurchase 购票记录
     * @return 购票记录集合
     */
    public List<BusTicketPurchase> selectBusTicketPurchaseList(BusTicketPurchase busTicketPurchase);

    /**
     * 新增购票记录
     * 
     * @param busTicketPurchase 购票记录
     * @return 结果
     */
    public int insertBusTicketPurchase(BusTicketPurchase busTicketPurchase);

    /**
     * 修改购票记录
     * 
     * @param busTicketPurchase 购票记录
     * @return 结果
     */
    public int updateBusTicketPurchase(BusTicketPurchase busTicketPurchase);

    /**
     * 删除购票记录
     * 
     * @param purchaseId 购票记录主键
     * @return 结果
     */
    public int deleteBusTicketPurchaseByPurchaseId(Long purchaseId);

    /**
     * 批量删除购票记录
     * 
     * @param purchaseIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBusTicketPurchaseByPurchaseIds(Long[] purchaseIds);

    /**
     * 校验指定人员当前是否拥有门票
     * @param userName
     * @param currentDate
     * @return
     */
    BusTicketPurchase checkNowHasPurchaseTicket(@Param("userName")String userName, @Param("date") Date currentDate);

    /**
     * 获取某人今天已核验的门票信息
     * @param username
     * @param startTime
     * @param endTime
     * @return
     */
    BusTicketPurchase getTodayVerifyTicket(@Param("userName")String username,
                                           @Param("startTime")String startTime,
                                           @Param("endTime")String endTime);

    /**
     * 获取所有人指定时间段内的购票情况
     * @param startTime
     * @param endTime
     * @return
     */
    List<BusTicketPurchase> getTodayAllVerifyTicket(@Param("startTime")String startTime,
                                                    @Param("endTime")String endTime);
}
